﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ITargetSystemRepository.cs" company="Elilink">
//   Defor
// </copyright>
// <summary>
//   Interface ITargetSystemRepository. For manipulating target systems and relying build configurations
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DataAccessLayer.Repositories.Abstract
{
    using System.Collections.Generic;

    using BusinessLayer.Objects;
    using BusinessLayer.Results;

    /// <summary>
    ///     Interface ITargetSystemRepository. For manipulating target systems and relying build configurations
    /// </summary>
    public interface ITargetSystemRepository
    {
        #region Public Methods and Operators

        /// <summary>
        /// Adds the target system.
        /// </summary>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <returns>
        /// The <see cref="OperationResult"/>.
        /// </returns>
        OperationResult AddTargetSystem(TargetSystem targetSystem);

        /// <summary>
        ///     Deletes all target systems.
        /// </summary>
        /// <returns>The <see cref="OperationResult"/>.</returns>
        OperationResult DeleteAllTargetSystems();

        /// <summary>
        /// Deletes the target system.
        /// </summary>
        /// <param name="targetSystemName">
        /// Name of the target system.
        /// </param>
        /// <returns>
        /// The <see cref="OperationResult"/>.
        /// </returns>
        OperationResult DeleteTargetSystem(string targetSystemName);

        /// <summary>
        ///     Disposes the context.
        /// </summary>
        void DisposeContext();

        /// <summary>
        ///     Gets the target systems.
        /// </summary>
        /// <returns>List of <see cref="TargetSystem"/>.</returns>
        List<TargetSystem> GetTargetSystems();

        /// <summary>
        /// Updates the target system.
        /// </summary>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <returns>
        /// The <see cref="OperationResult"/>.
        /// </returns>
        OperationResult UpdateTargetSystem(TargetSystem targetSystem);

        /// <summary>
        /// Updates the target system. Updates only Build configuration!! If old name is not equal to current - also names for
        ///     target system and dependant projects will be changed
        /// </summary>
        /// <param name="targetSystem">
        /// The target system.
        /// </param>
        /// <param name="oldTargetSystemName">
        /// Old name of the target system.
        /// </param>
        /// <returns>
        /// The <see cref="OperationResult"/>.
        /// </returns>
        OperationResult UpdateTargetSystemWithName(TargetSystem targetSystem, string oldTargetSystemName);

        #endregion
    }
}